package org.wheel.jpa.id;

import org.hibernate.HibernateException;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.id.IdentifierGenerator;
import org.wheel.base.id.SnowflakeIdGenerator;

public class IntegerIdGenerator implements IdentifierGenerator {

    @Override
    public Integer generate(SharedSessionContractImplementor session, Object object) throws HibernateException {
        return SnowflakeIdGenerator.getInstance().nextId().intValue();
    }
}